package com.zyf.project.kvdb.protocol.proto.impl;

import com.zyf.project.kvdb.protocol.proto.Command;
import utils.binary.impl.Bytes;

/**
 * <h1>KVDB 命令行指令</h1>
 * <p>实现了 {@link Command}</p>
 *
 * @author Zhou Yifan
 */
public class KVDBCommand implements Command {


    private String name;
    private Bytes[] parameters;

    public KVDBCommand(String name, Bytes... parameters) {
        this.name = name;
        this.parameters = parameters;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setParameters(Bytes... parameters) {
        this.parameters = parameters;
    }


    /**
     * @return 命令名称
     */
    @Override
    public String getName() {
        return name;
    }

    /**
     * @return 参数列表，{@link Bytes} 类型数组
     */
    @Override
    public Bytes[] getParameters() {
        return parameters;
    }
}
